{extend name='template/base'}{/extend}
{block name='style'}
<link rel="stylesheet" href="__STATIC__/admin/extend/css/admin_lsx.min.css">
{/block}
{block name='script'}{/block}
{block name='content'}
<div class="login-box">
    <div class="header">
        <h1>{$Think.config.site.name}</h1>
    </div>

    <div class="login-box-body">
        <form class="form form-horizontal" action="{:url('pub/login_submit')}" method="post" id="form">
            <div class="row cl">
                <label class="form-label col-xs-3 col-ms-3" style="line-height: 36px;font-size: 20px;">帐号</label>
                <div class="formControls col-xs-6 col-ms-6">
                    <input name="username" type="text" placeholder="帐号" class="input-text size-L" datatype="*" nullmsg="请填写帐号">
                </div>
                <div class="col-xs-3 col-ms-3"></div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-3 col-ms-3" style="line-height: 40px;font-size: 20px;">密码</label>
                <div class="formControls col-xs-6 col-ms-6">
                    <input name="password" type="password" placeholder="密码" class="input-text size-L" datatype="*" nullmsg="请填写密码">
                </div>
                <div class="col-xs-3 col-ms-3"></div>
            </div>
            <div class="row cl">
                <div class="formControls col-xs-6 col-ms-6 col-xs-offset-3 col-ms-offset-3">
                    <input name="captcha" class="input-text size-L" type="text" placeholder="验证码" style="width:100px;min-width: auto" datatype="*" nullmsg="请填写验证码">
                    <img id="captcha" src="{:captcha_src()}" onclick="this.src='{:captcha_src()}?id='+Math.random()" alt="验证码" title="点击刷新验证码" style="cursor:pointer;width: 150px;height: 40px">
                </div>
                <div class="col-xs-3 col-ms-3"></div>
            </div>
            <div class="row cl">
                <div class="formControls col-xs-6 col-xs-offset-3">
                    <label for="online">
                        <input type="checkbox" name="online" id="online" value="1">
                        使我保持登录状态
                    </label>
                    <span id="msgdemo2" style="margin-left:30px;line-height: 10px"></span>
                </div>
            </div>
            <div class="row cl">
                <div class="formControls col-xs-9 col-xs-offset-3">
                    <input name="" type="submit" class="btn btn-success radius size-L mr-20" value="&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;">
                    <input name="" type="reset" class="btn btn-default radius size-L" value="&nbsp;重&nbsp;&nbsp;&nbsp;&nbsp;置&nbsp;">
                </div>
            </div>
        </form>
    </div>
    <div class="footer">Copyright yuan1994 by {$Think.config.site.name} {$Think.config.site.version}</div>
</div>
{/block}
{block name='script_extra'}
<script>
    $(function () {
        $(document.body).attr('class', 'hold-transition login-page mybody');
    });
    var tip=2;
    var flag=1;
    if($(window).width()<700){
        tip=function(msg,o,cssctl){
            var objtip=$("#msgdemo2");
            cssctl(objtip,o.type);
            objtip.text(msg);
        };
        flag=0;
    }
    $("#form").Validform({
        tiptype:tip,
        showAllError:flag,
        ajaxPost: true,
        callback: function (res) {
            if (res.success == false){
                $("#captcha").click();
                $("[name='captcha']").val('');
                layer.alert(res.message, {
                    icon: 5
                })
            } else {
                layer.msg('登录成功', {time: 1500},function () {
                    location.href = '{:url("index/index")}'
                });
            }
        }
    });
</script>
{/block}







